/*
 * ChangeSettingsAction.java
 *
 * Copyright 2007, 2008 Tiberiumlabs
 *
 * This file is part of Tiberiumlabs Lailaps.
 *
 * Tiberiumlabs Lailaps is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * Tiberiumlabs Lailaps is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package org.tiberiumlabs.lailaps.actions.system;

import java.awt.event.ActionEvent;
import javax.swing.JFrame;
import org.tiberiumlabs.lailaps.actions.AbstractResourcedAction;
import org.tiberiumlabs.lailaps.resources.ImageLoader;
import org.tiberiumlabs.lailaps.settings.gui.OptionsWindow;
import org.tiberiumlabs.swing.DesktopToolkit;

/**
 *
 * @author <a href="mailto:paranoid.tiberiumlabs@gmail.com">Paranoid</a>
 */
public class ChangeSettingsAction extends AbstractResourcedAction {

    /** Creates a new instance of ChangeSettingsAction */
    public ChangeSettingsAction() {
        putValue(NAME, bundle.getString("settings.name"));
        putValue(SHORT_DESCRIPTION, bundle.getString("settings.short"));
        putValue(LONG_DESCRIPTION, bundle.getString("settings.long"));
        putValue(LARGE_ICON_KEY, ImageLoader.getSettingsIcon());
        putValue(SMALL_ICON, ImageLoader.getMenuSettings());
    }

    public void actionPerformed(ActionEvent e) {
        JFrame settingFrame = new JFrame("Options");
        settingFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        settingFrame.setContentPane(new OptionsWindow(settingFrame, false));
        settingFrame.pack();
        settingFrame.setLocation(DesktopToolkit.getWindowLocation(settingFrame.getSize()));
        settingFrame.setVisible(true);
    }

}
